<#-- 
 
 crea una clase para un listado_...aspx para la tabla  ${table}...
 Author : Luis Molina...
 
 -->
<#-- variables used internally by the generator... -->
<#assign nameFile="main_${table}">
<#assign extensionFile="aspx">
<#assign languageGenerated="c#">
<#assign description="description">
<#assign targetDirectory="${table}_dir">
<#assign appliesToAllTables="true">
<#-- END variables used internally by the generator... -->

<%@ Page Language="C#" MasterPageFile="~/admin/master/masterAdmin.Master" AutoEventWireup="true"  CodeBehind="main_${table}.aspx.cs" Inherits="${project}.${table}_dir.main_${table}" Title="Página sin título" %>
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FTB" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


	<div id="contenido">
	    <asp:Repeater ID="RepeaterBarraNavegacion" runat="server">
        <ItemTemplate>
            ><a href="<%#Eval("url")%>"><%#Eval("nombre")%></a>
        </ItemTemplate>
    </asp:Repeater>			
				<!--barra titulos-->
				<div class="titulos">
					<div class="itemTit">
					  <h2 class="textoTit">
                          ${table}</h2>
					</div>
				</div>
				<!--barra titulos-->
				
				<div class="addCategorias">
				 <asp:Panel ID="Panel1" runat="server">
				<ul  class="pestCat">
					<li><a href="../${table}_dir/main_${table}.aspx" class="addCat">Nuevo ${table}</a></li>
					<li><a href="../${table}_dir/listado_${table}.aspx" class="modCat" >Listado ${table}</a></li>
					
				</ul>
				</asp:Panel>
				</div>
				
				<!--subseccion 1-->
					<div class="subseccion">
					<div class="titSubseccion">
					  <h3 class="itemh3">
                          Rellene los datos</h3>
					</div>
					
		 	
<#assign count=0>
<#list table.getFields() as field>
  <#if (!field.getisKey())>

   
     <#-- segun el tipo de campo...   -->
     <#switch field.getTargetType()>
              <#case "_int">
                <#if (field.getisForeignKey())>				
					<div class="lineaForm">
						<label for="${field}">				
						<span class="etiqueta">${field.getTargetName()}: </span>
						<asp:DropDownList ID="cmb${field}" runat="server">
						</asp:DropDownList>
						<asp:ImageButton ID="ibNew${field}" runat="server" ImageUrl="~/images/anadirCat.gif" OnClick="ibNew${field}_Click" />
					</label>
					</div>		
            <#else>
				<div class="lineaForm">
                <label for="${field}">
                        <span class="etiqueta">${field.getTargetName()}: </span>
                        <asp:TextBox ID="txt${field}"   runat="server"></asp:TextBox>
                    </label>
					</div>		
            </#if>

                
                 <#break>
              <#case "_string">
			  	<div class="lineaForm">
                   <label for="${field}">
                        <span class="etiqueta">${field.getTargetName()}: </span>
						<#if (field.getSize() >= 251)>
						   <FTB:FreeTextBox ID="txt${field}" runat="server" Language="es-ES">
						   </FTB:FreeTextBox>
						<#else>
							<asp:TextBox ID="txt${field}" Width="50%" runat="server"></asp:TextBox>
						 </#if>                        
                    </label>
						</div>		
                 <#break>
              <#case "_date">
			  	<div class="lineaForm">
                 <label for="${field}">
                        <span class="etiqueta">${field.getTargetName()}: </span>
                         <ew:CalendarPopup ID="${field}" runat="server" >
                         </ew:CalendarPopup>
                    </label>
						</div>		
                 <#break>
              <#case "_boolean">
			  	<div class="lineaForm">
                  <label for="${field}">
                        <span class="etiqueta">${field.getTargetName()}: </span>
                        <asp:CheckBox ID="ck${field}"   runat="server" />
                    </label>
						</div>		
                 <#break>
				<#case "_image">
					<div class="lineaForm">
						<span class="etiqueta">${field}
						</span>
                            <asp:Image ID="img${field}" runat="server" Visible="False" Width="40px" />
                            <asp:Button ID="btnborrarimagen${field}" runat="server" CssClass="btn" OnClick="btnborrarimagen${field}_Click"
                                Text="Borrar imagen" Visible="False" />
                            <span class="zonacampo">
                             <label for="FileUploadImagen${field}"><asp:FileUpload ID="FileUploadImagen${field}" runat="server" Width="328px" CssClass="textstandar" /></label>
                            </span>
                            <br />
                            <br />
                            <asp:Label ID="lblinfo${field}" CssClass="camporojo" runat="server" Text=""></asp:Label>
                    </div>
				<#break>
              <#default>
			  	<div class="lineaForm">
                 <label for="${field}">
                        <span class="etiqueta">${field.getTargetName()}: </span>
                        <asp:TextBox ID="txt${field}" Width="50%" runat="server"></asp:TextBox>
                    </label>
						</div>		
    </#switch>  
    <#assign count = count+1>
 </#if>
</#list>			
			
			
 
					    <div class="lineaForm">
            
                            <asp:Label ID="lblinfo" Visible="false" CssClass="camporojo" runat="server" Text=""></asp:Label>
 
						</div>
					
					</div><!--subsecciones-->
					
					
					<div class="botonesSub"></div>
					
					
					
					<!--botones formulario-->
					<div class="botonesSub">
					       

					<span>
                         <asp:Button ID="butModificar" runat="server" CssClass="aceptar" OnClick="butModificar_Click" Text="Modificar" />
					</span>
					<span>
                         <asp:Button ID="butCancelar" runat="server" CssClass="denegar" OnClick="butCancelar_Click" Text="Cancelar" />
				    </span>
					</div>
					<!--botones formulario-->
				
				</div>









 
 
</asp:Content>
